﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Argument.All.Are.Not
{
    [TestClass]
    public class NullAttributeTest
    {
        [Arcana.Contract.Argument.All.Are.Not.Null("arg")]
        public static void Target_1(Stack<string> arg)
        {
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentException))]
        public void ShouldThrowException()
        {
            Stack<string> arg = new Stack<string>();
            foreach (var item in new string[] { "a", "b", "c", null, "d", "e" })
            {
                arg.Push(item);
            }
            Target_1(arg);
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        public void ShouldPass()
        {
            Stack<string> arg = new Stack<string>();
            Target_1(arg);
            foreach (var item in new string[] { "a", "b", "c", "cc", "d", "e" })
            {
                arg.Push(item);
            }
            Target_1(arg);
        }
    }
}
